import React,{lazy,Suspense} from 'react'
import Loading from '../component/Loading'
import {Switch,Route,Redirect} from 'react-router-dom'
const Welcome =lazy(()=>import('../views/index/Welcome'))
const UserIndex=lazy(()=>import('../views/user/Index'))
const Adminrouter = () => {
    return (
       <Suspense fallback={<Loading/>}>
           <Switch>
               <Redirect from='/dashboard' to='/dashboard/welcome'></Redirect>
               <Route path='/dashboard/welcome' component={Welcome}></Route>
               <Route path='/dashboard/user/index' component={UserIndex}></Route>
           </Switch>
       </Suspense>
    );
}

export default Adminrouter;

